﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


using Site.Business.Interfaces;
using System.Data;
using System.Data.SqlClient;

namespace Site.Data
{
    public class SqlConnectionFactory: IDbConnectionFactory
    {
        //private IDbConnection _connection;
        private readonly string _connectionString;
        
        public SqlConnectionFactory(string connectionString)
        {
           // _connection = connection;
            this._connectionString = connectionString;
        }

        public IDbConnection CreateConnection()
        {
            var con = new SqlConnection(_connectionString);
            con.Open();
            return con;
        }
    }
}
